Tokens for Repeat
The Repeat activity produces the following token.
Name | Description | Sample Syntax* |
---|---|---|
Iteration | The number of times the Repeat activity has repeated. | %(Repeat_Iteration) |
*The "Repeat" portion of the syntax changes to match the activity's name as specified in the Activity Name property box. All non-alphanumeric characters, except underscores, are removed from the name.
Example: If you rename the activity "Process & Fill," the syntax for the Iteration token will be %(ProcessFill_Iteration).
Note: You can use the Repeat activity’s Iteration token (in conjunction with token indexing) to access a specific value in a multi-value token. However, if your Repeat activity is configured to be zero-based, and if you try to map the iteration count directly to a multi-value token, the values will always be off by one (because multi-value tokens are indexed starting with the number one). To solve this issue, either change your Repeat activity to start at one in the Options property box or use the Token Calculator activity to add one to the Iteration token before using it to retrieve a specific value from a multi-value token.
Example: Jim has a PDF form containing a table that lists items and their prices in two separate columns. He wants to list the items with their corresponding prices in the body of an e-mail. Using the Table tab in the Retrieve PDF Form Content activity, he creates two multi-value tokens: one containing a list of the items and another containing a list of the prices. Then, he creates an Item-Price Pairings token using the Assign Token Values activity. To populate this token, he uses a Repeat activity whose options are configured so that the Iteration token starts at 1. The Repeat activity's condition is configured so that the activity runs as long as the Iteration token is less than or equal to the number of values in the Retrieve PDF Form Content's Items token. To retrieve the number of values in the Items token, Jim applies the Value Count function to the token with the Token Editor. Inside the Repeat activity is another Assign Token Values activity which combines each item with its price. The Item and Price tokens are indexed in the Token Editor with the Iteration token. Finally, he sends the list of items and prices out in an e-mail by using the Item-Price Pairings token. Show me what this looks like.